# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Sébastien Duquette <ekse.0x@gmail.com>
# Contributor: Dawid Wrobel <cromo@klej.net>

pkgname=tcpreplay
pkgver=4.4.3
pkgrel=1
pkgdesc='Gives the ability to replay previously captured traffic in a libpcap format'
url='https://tcpreplay.appneta.com'
arch=('loong64' 'x86_64')
license=('GPL3')
depends=('libpcap' 'libdnet' 'autogen')
makedepends=('tcpdump')
optdepends=('tcpdump: decoding of packets support')
options=('!emptydirs')
source=(https://github.com/appneta/tcpreplay/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz{,.asc})
sha512sums=('f69137ef41d16f4acda4190245f73f0b3db950783e5a6fc3374c27eae80c8bf096f5392c18c1b33b90bc32380625c5b5f149f7ec1c50b971ddd761279abffe68'
            'SKIP')
b2sums=('4aebf1ae6f43a0fa51a9a0bb7220a23de0115748e0c659b207dfc2d438b371829edf9f34f4de9b8d4aafa64acc1b4ddf93d07327b4fed0785caa9deac141ceaa'
        'SKIP')
validpgpkeys=('84E4FA215C934A7D97DC76D5E9E2149793BDE17E') # Fred Klassen <tcpreplay@appneta.com>

prepare() {
  cd ${pkgname}-${pkgver}
  autoreconf -fiv
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --disable-local-libopts \
    --enable-dynamic-link \
    --enable-shared \
    --with-libdnet \
    --with-tcpdump=/usr/bin/tcpdump \
    ac_cv_header_net_bpf_h=n
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make -j1 -C test tcpprep
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
